package com.test.demo2;

public class Computer {
    //只有在这个类中才能使用
    private String cpu;
    private String gpu;

    //公共的，都可以使用
    public String screen;

    //包访问权限 只有在这包里使用
    String brand;


    public Computer(String cpu, String gpu, String screen, String brand) {
        this.cpu = cpu;
        this.gpu = gpu;
        this.screen = screen;
        this.brand = brand;
    }

    public void turnOn(){
        System.out.println("开机");
    }

    public void turnOff(){
        System.out.println("关机");
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getCpu() {
        return cpu;
    }
}
